<html>
<head>
	<meta charset="UTF-8">
	<title>系统应用信息修改</title>
	<link id="easyuiTheme"  href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout" scroll="no">
	<form id="ff" method="post">
		<div class="esaas-info-title">系统应用信息信息</div>
		<table class="esaas-info-edit-table">
			<tr>
				<td width="15%" align="right">应用标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text" readOnly
					name="appId" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">应用代码：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appCode" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">应用名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">架构类型：</td>
				<td width="35%"><select class="easyui-combobox"
					id="archType" name="archType"
					style="width: 100%; height: 25px;" 
					data-options="required:false,editable:false,valueField:'enname',textField:'cnname',data:ARCH_TYPE">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right">应用版本：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appVersion" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">应用排列顺序：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appOrder" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">系统ID：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="sysId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">系统代码：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="sysCode" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">系统名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="sysName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">工程标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="projectId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">工程代码：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="projectCode" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">工程名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="projectName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">应用模板标识：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appTemplateId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">应用模板名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appTemplateName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div style="text-align: center; padding: 15px">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			onclick="submitForm()">&nbsp;保&nbsp;存&nbsp;</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>
		$(function() {
			var appId = $.getUrlParam('packageId');
			$.restfulGet('../../api/paas/apps/info/' + appId,null,function(data){
				$('#ff').form('load', {
					appId : data.rows.appId,
					appCode : data.rows.appCode,
					appName : data.rows.appName,
					archType : data.rows.archType,
					appVersion : data.rows.appVersion,
					appOrder : data.rows.appOrder,
					sysId : data.rows.sysId,
					sysCode : data.rows.sysCode,
					sysName : data.rows.sysName,
					projectId : data.rows.projectId,
					projectCode : data.rows.projectCode,
					projectName : data.rows.projectName,
					appTemplateId : data.rows.appTemplateId,
					appTemplateName : data.rows.appTemplateName,
					appOpState : data.rows.appOpState,
					createUser : data.rows.createUser,
					createTime : data.rows.createTime,
					lastUpdateUser : data.rows.lastUpdateUser,
					lastUpdateTime : data.rows.lastUpdateTime
				});
			});
		});
	
		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPut('../../api/paas/apps/info', jsonData, function(data) {
				let treeObj = {
					packageId : jsonData.appId,
					packageCode : jsonData.appCode,
					packageName : jsonData.appName,
				}
				$.restfulPut('../../api/paas/sys/tree', treeObj, function(data) {
					window.parent.reloadTree();
					closeForm();
				});
			});
		};
		
		function closeForm(){
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
